//
//  LSZTabAudioSearchResultsManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/5/21.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZTabAudioSearchResultsManager.h"

@implementation LSZTabAudioSearchResultsManager
-(id)initWithTabAudioSearchResults :(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        NSMutableArray * AddArrayMg = [[NSMutableArray alloc]init];
        for (NSDictionary * diction in arrayData) {
            LSZTabAudioSearchResultsMg * mg = [[LSZTabAudioSearchResultsMg alloc]init];
            mg.id_id = NullStringjudgment(NSStr(diction[@"id"]));
            mg.type  = NullStringjudgment(NSStr(diction[@"type"]));
            mg.title = NullStringjudgment(NSStr(diction[@"title"]));
            mg.singerName = NullStringjudgment(NSStr(diction[@"singerName"]));
            if ([[diction allKeys] containsObject:@"image"]) {
                mg.image   = NullStringjudgment(NSStr(diction[@"image"]));
            }
            if ([[diction allKeys] containsObject:@"cover_img"]) {
                mg.cover_img   = NullStringjudgment(NSStr(diction[@"cover_img"]));
            }
            if ([[diction allKeys] containsObject:@"total_song"]) {
                mg.total_song   = NullStringjudgment(NSStr(diction[@"total_song"]));
            }
            if ([[diction allKeys] containsObject:@"parentId"]) {
                mg.parentId   = NullStringjudgment(NSStr(diction[@"parentId"]));
            }
            if ([[diction allKeys] containsObject:@"duration"]) {
                mg.duration   = NullStringjudgment(NSStr(diction[@"duration"]));
            }
            if ([[diction allKeys] containsObject:@"fileUrl"]) {
                mg.fileUrl   = NullStringjudgment(NSStr(diction[@"fileUrl"]));
            }
            if ([[diction allKeys] containsObject:@"album"]) {
                mg.album   = NullStringjudgment(NSStr(diction[@"album"]));
            }
            if ([[diction allKeys] containsObject:@"click"]) {
                 mg.originalClick = NullStringjudgment(NSStr(diction[@"click"]));
                 mg.click  = [LSZSpecialPackaging theNumberViewsForTheAlbumAhanges:mg.originalClick];
            }
            if ([[diction allKeys] containsObject:@"shareUrl"]) {
                mg.shareUrl   = NullStringjudgment(NSStr(diction[@"shareUrl"]));
            }
            if ([[diction allKeys] containsObject:@"hits"]) {
                mg.originalHits   = NullStringjudgment(NSStr(diction[@"hits"]));
                mg.hits = [LSZSpecialPackaging theNumberViewsForTheAlbumAhanges:mg.originalHits];
            }
            if ([[diction allKeys] containsObject:@"likes"]) {
                mg.likes   = NullStringjudgment(NSStr(diction[@"likes"]));
            }
            if ([[diction allKeys] containsObject:@"album_name"]) {
                mg.album_name = NullStringjudgment(NSStr(diction[@"album_name"]));
            }
            if ([[diction allKeys] containsObject:@"artist_name"]) {
                mg.artist_name = NullStringjudgment(NSStr(diction[@"artist_name"]));
            }
            [AddArrayMg addObject:mg];
        }
        self.arrayData = AddArrayMg;
    }
    return self;
}
@end
@implementation LSZTabAudioSearchResultsMg

@end
